class StaticController < ApplicationController
  # GET /static/name
  # GET /static/name.json
  
  def show
    if params[:permalink]
      @page = StaticPage.find_by_permalink(params[:permalink])
      raise ActiveRecord::RecordNotFound, "Page not found" if @page.nil?
    else
      @page = StaticPage.find(params[:id])
    end
    
    respond_to do |format|
      format.html # show.html.erb
      format.json { render json: @page }
    end
  end
end
